import { RouteObject, useRoutes } from 'react-router-dom';
import App from '../App'; // 确保路径正确
import Home from '../pages/HomePage/HomePage';
import Example from '../pages/ExamplePage/ExamplePage'
// 定义路由映射
const routes: RouteObject[] = [
  {
    path: '/',
    element: <App />, // 确保 App 是一个 React 组件
    children:[
      {
        path:'/home',
        element:<Home></Home>
      },
      {
        path:'/example',
        element:<Example></Example>
      }
    ]
  },
];

// 路由组件
const Routes = () => {
  return useRoutes(routes);
};

export default Routes;